/*
 * @Description: 国际化切换工具函数
 * @Author: 0001100986/LiuShuai
 * @Date: 2021-06-22 14:09:49
 * @LastEditTime: 2021-07-16 09:37:57
 * @LastEditors: 0001100986/LiuShuai
 */
import store from '@/store';

// 智能转换语言
export function switchLanguage (cn, en) {
  let text = '';
  let { language } = store.state.user.user;

  switch (language) {
    case 'cn':
      text = cn;
      break;
    case 'en':
      text = en;
      break;
    default:
      text = 'cn';
  }

  return text;
}